1. Field of the Invention
The present invention relates to an image processing device, an image processing method and a computer program product.
2. Description of the Related Art
With image processing devices, an original document is read by a reading device such as a scanner. The images read out are then subjected to various image processing and image correction. When, for example, an original document is tilted while inputting an original document from image equipment such as a copier, processing such as skew correction processing for correcting tilting of an image, and noise removal processing etc. for removing isolated point noise present within the image is carried out.
For example, Japanese Patent Application Laid-open No. H8-320916 discloses a conventional technology for detecting tilting of an original document image. Specifically, circumscribed rectangles circumscribing character and pattern blocks at corner portions of a document image are detected. A scanning line is then made to rotate centered about a point of intersection of a detected side of a circumscribed rectangle and a side of a character and pattern block. A maximum rotation angle where character and pattern elements are not detected on a scanning line (the angle where character and pattern elements are first detected) is then detected as tilting correction for an original document image that is a target of processing. The above processing is then carried out for all corner portions, and an average value is detected as the tilting of the original document image.
However, when an original document is inputted from image equipment such as a copier or scanner, for example, the color of pressure plates of image input equipment becomes black. When there is then a difference between the size of the original document and the size of a reading region, an image region occurs for black pixels corresponding to outside of the original document surrounding the inputted image (the same is also the case for images obtained via a network). The image region for the black pixels is information (noise information) that is not necessary for the user using the image equipment. When it is wished to know the actual original size, it is preferable for only images corresponding to original documents where unnecessary noise information has been cut-out automatically to be acquired. With recent image equipment, it is possible to specify resolution in the X-direction and Y-direction independently as conditions at the time of input. For example, it is possible to perform image inputting using conditions of 300 dpi in an X-axis direction and 75 dpi in a Y-axis direction (see FIG. 11A for an image before processing and FIG. 11B for an image after processing).
Regarding this situation, the conventional technology disclosed in the Japanese Patent Application Laid-open No. H8-320916 carries out processing on the assumption that, in order to detect tilting by using character regions and blank regions, a boundary formed by a character region and a blank region is a substantial straight line. Therefore, it is difficult to apply the conventional technology to an image when there is no blank region or when the character region is small in the image.
Moreover, tilting (tilting α) of an original document image in image data inputted based on the same resolution for the X-axis direction and Y-axis direction and tilting (tilting β) of an original document image within image data inputted based on different resolutions for the X-axis direction and Y-axis direction are different. This means that the tilting (tilting β) of the original document image in the image data inputted using different resolutions for the X-axis direction and Y-axis direction is different from the originally detected tilting (tilting α). Therefore, it is not possible to detect the tilting (tilting α) correctly using the invention disclosed in the Japanese Patent Application Laid-open No. H8-320916 when image data is inputted based on different resolutions for the X-axis direction and Y-axis direction.
FIG. 13 is a view explaining the theory when tilting a and tilting β are different. When the Y-axis direction is read using a lower resolution than for the X-axis direction, the original document image (pixels) for the Y-axis direction of an original document image 1302 of an inputted image 1301 is thinned out. For example, a position “A” in the lower left-hand corner of the original document image 1302 is moved to a position “A′” in the lower left-hand corner of the inputted image 1301. Therefore, the tilting of the original document image 1302 within the inputted image 1301 inputted based on a different resolution for the X-axis direction and the Y-axis direction becomes the tilting β regardless of the actual tilting of an original document image 1302 being the tilting α.